﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMD.DataModel.Entity
{
    /** 
  * <p>类说明:指标定义</p>
  * @version 1.0
  * <p>文件名： </p>
  * <p>创建人及时间： xiangyuliang 2011-8-27</p>
  * <p>修改人：</p>
  * <p>修改时间：</p>
  * <p>修改描述：</p>
  **/
    public class IndiceDefine : BusinessEntity
    {
        //public string id { get; set; }
        //private string _name;  //名称
        private string _itemId; //指标标识
        private string _unit;  //单位 
        private string _normalValue;  //指标正常值
        private int _columnNo;  //列号
        private string _columnType;   //列类型
        private string _specLevel;   //指标等级
      
        [CheckValue("指标定义“指标标识”不能为空")]
        public String ItemId
        {
            get
            {
                return _itemId;
            }
            set
            {
                _itemId = value;
                OnPropertyChanged(() => ItemId);
            }
        }
        //[CheckValue("指标定义“单位”不能为空")]
        public String Unit
        {
            get
            {
                return _unit;
            }
            set
            {
                _unit = value;
                OnPropertyChanged(() => Unit);
            }
        }
       // [CheckValue("指标定义“正常参考值”不能为空")]
        public string NormalValue
        {
            get
            {
                return _normalValue;
            }
            set
            {
                _normalValue = value;
                OnPropertyChanged(() => NormalValue);
            }
        }
        [CheckValue("指标定义“列号”不能为空")]
        public int ColumnNo
        {
            get
            {
                return _columnNo;
            }
            set
            {
                _columnNo = value;
                OnPropertyChanged(() => ColumnNo);
            }
        }
        [CheckValue("指标定义“列类型”不能为空")]
        public String ColumnType
        {
            get
            {
                return _columnType;
            }
            set
            {
                _columnType = value;
                OnPropertyChanged(() => ColumnType);
            }
        }
        public String SpecLevel
        {
            get
            {
                return _specLevel;
            }
            set
            {
                _specLevel = value;
                OnPropertyChanged(() => SpecLevel);
            }
        }
        public override void setValue(string key, Object value)
        {
            if (value is System.DBNull)
                return;
            switch (key.ToLower())
            {
                case "id":
                    this.Id = (string)value;
                    break;
                case "name":
                    this.Name = (string)value;
                    break;
                case "itemid":
                    this.ItemId = (string)value;
                    break;
                case "unit":
                    this.Unit = (string)value;
                    break;
                case "normalvalue":
                    this.NormalValue = (string)value;
                    break;
                case "columnnum":
                    this.ColumnNo = int.Parse( value.ToString());//int.Parse((string)value);
                    break;
                case "columntype":
                    this.ColumnType = (string)value;
                    break;
                default:
                    break;
            }
        }
    }
    
}
